#include "NetClass.h"
#include <assert.h>
#include <rpcFw\CodecInf.h>

DNetServer::DNetServer():
m_ServerInf(new DServerInf())
{
	m_pTcpServer = HP_Create_TcpServer(m_ServerInf);
	m_pTcpServer->SetWorkerThreadCount(1);
}

DNetServer::~DNetServer()
{

}

void DNetServer::init(std::string addr, int port)
{
	if (!m_pTcpServer->Start(addr.c_str(), port))
	{
		DWORD ret = GetLastError();
		assert(false);
	}
}

void DNetServer::sendData(const Variant &)
{
}

void DNetServer::setRecvCb(const RecvCallback &recvCb)
{
    m_recvCb=recvCb;
}

void DNetServer::setErrorCb(const ErrCb &)
{
    
}